Technical Q&A QA1088
Is QuickTime thread-safe?


Q: Is QuickTime thread-safe? For example, is it possible to use DecompressSequence in one thread, and use QuickTime to play audio in another thread?

A: QuickTime is not reentrant.

On Mac OS X, QuickTime is also not reentrant. You will not be able to call QuickTime from multiple threads without risking a crash.

However, on the PC you can safely call QuickTime from different threads in your multi-threaded Windows application so one could argue QuickTime is multithread-safe. But in actuality, the safety is simply because QuickTime only allows one thread at a time into its API set. QuickTime has a "gatekeeper" critical section that forces all but one of the threads calling into QuickTime to wait until the one "lucky" thread returns out of QuickTime, at which time one of the waiting threads is allowed to enter. So we hesitate to claim boldly we support multi-threaded applications in all their glory, because if all your threads are doing QuickTime work they end up getting serialized.

We are working on making QuickTime thread-safe, but it is a large undertaking and will take some time to implement.


[Nov 01 2001]


Developer Documentation | Technical Notes | Development Kits | Sample Code